*************************************************************************************************************************************************  TABLE 6, Additional Balance Check ***********************************************************************************************************************************************************columns 1&2, RR&TT;use "/Users/apple/Dropbox/2001/Dupas replication/datasets/SD2005_rev2.dta", cleargen RRWithoutTT=1 if sampleSD==1 & HIVtreat==0gen RRandTT=1 if sampleSD==1 & HIVtreat==1gen noRRnoTT=1 if sampleSD==0 & HIVtreat==0gen TTnoRR=1 if sampleSD==0 & HIVtreat==1gen attrit=1-update05v2collapse sampleSD RRandTT HIVtreat repeat8 secschool training athome attrit evdead05v2 Nobs, by(schoolid girl)bys girl RRandTT : egen Nschools=count(schoolid)bys girl RRandTT : egen Ntotalobs=sum(Nobs)collapse (mean) repeat8 secschool training athome attrit evdead05v2 Ntotalobs Nschools if RRandTT==1, by(girl sampleSD)**tab schoolid if RRandTT==1, freq - **something going on with the number of schools here *columns 1&2, TT and no RR;use "/Users/apple/Dropbox/2001/Dupas replication/datasets/SD2005_rev2.dta", cleargen RRWithoutTT=1 if sampleSD==1 & HIVtreat==0gen RRconTT=1 if sampleSD==1 & HIVtreat==1gen RRandTT=1 if sampleSD==1 & HIVtreat==1gen noRRnoTT=1 if sampleSD==0 & HIVtreat==0gen TTnoRR=1 if sampleSD==0 & HIVtreat==1gen attrit=1-update05v2collapse sampleSD TTnoRR HIVtreat repeat8 secschool training athome attrit evdead05v2 Nobs, by(schoolid girl)bys girl TTnoRR : egen Nschools=count(schoolid)bys girl TTnoRR : egen Ntotalobs=sum(Nobs)collapse (mean) repeat8 secschool training athome attrit evdead05v2 Ntotalobs Nschools if TTnoRR==1, by(girl sampleSD)*Column 3use "/Users/apple/Dropbox/2001/Dupas replication/datasets/SD2005_rev2.dta", cleargen RRWithoutTT=1 if sampleSD==1 & HIVtreat==0gen RRconTT=1 if sampleSD==1 & HIVtreat==1gen RRandTT=1 if sampleSD==1 & HIVtreat==1gen noRRnoTT=1 if sampleSD==0 & HIVtreat==0gen TTnoRR=1 if sampleSD==0 & HIVtreat==1gen attrit=1-update05v2*for GIRLcollapse sampleSD HIVtreat repeat8 secschool training athome attrit evdead05v2 Nobs , by(schoolid girl)xi: reg repeat8  sampleSD if girl==1 & HIVtreat==1outreg sampleSD using results\SDoutcomesdiff.xls, nolabel nocons se ctitle ("repeat8")    3aster  replaceforeach var of varlist secschool training athome attrit evdead05v2 {	reg `var'  sampleSD if girl==1 & HIVtreat==1	}*for BOYforeach var of varlist repeat8 secschool training athome attrit evdead05v2 {	reg `var'  sampleSD if girl==0 & HIVtreat==1}*Cols 1 & 2, RR but no TTuse "/Users/apple/Dropbox/2001/Dupas replication/datasets/SD2005_rev2.dta", cleargen RRWithoutTT=1 if sampleSD==1 & HIVtreat==0gen RRconTT=1 if sampleSD==1 & HIVtreat==1gen RRandTT=1 if sampleSD==1 & HIVtreat==1gen noRRnoTT=1 if sampleSD==0 & HIVtreat==0gen TTnoRR=1 if sampleSD==0 & HIVtreat==1gen attrit=1-update05v2collapse sampleSD RRWithoutTT HIVtreat repeat8 secschool training athome attrit evdead05v2 Nobs, by(schoolid girl)bys girl RRWithoutTT : egen Nschools=count(schoolid) **again something going on with schoolsbys girl RRWithoutTT: egen Ntotalobs=sum(Nobs)collapse (mean) repeat8 secschool training athome attrit evdead05v2 Ntotalobs Nschools if RRWithoutTT==1, by(girl sampleSD)**neither RR nor TTuse "/Users/apple/Dropbox/2001/Dupas replication/datasets/SD2005_rev2.dta", cleargen RRWithoutTT=1 if sampleSD==1 & HIVtreat==0gen RRconTT=1 if sampleSD==1 & HIVtreat==1gen RRandTT=1 if sampleSD==1 & HIVtreat==1gen noRRnoTT=1 if sampleSD==0 & HIVtreat==0gen TTnoRR=1 if sampleSD==0 & HIVtreat==1gen attrit=1-update05v2collapse sampleSD noRRnoTT HIVtreat repeat8 secschool training athome attrit evdead05v2 Nobs, by(schoolid girl)bys girl noRRnoTT : egen Nschools=count(schoolid)bys girl noRRnoTT : egen Ntotalobs=sum(Nobs)collapse (mean) repeat8 secschool training athome attrit evdead05v2 Ntotalobs Nschools if noRRnoTT==1, by(girl sampleSD)*Column 3 - for RR&TTuse "/Users/apple/Dropbox/2001/Dupas replication/datasets/SD2005_rev2.dta", cleargen RRWithoutTT=1 if sampleSD==1 & HIVtreat==0gen RRconTT=1 if sampleSD==1 & HIVtreat==1gen RRandTT=1 if sampleSD==1 & HIVtreat==1gen noRRnoTT=1 if sampleSD==0 & HIVtreat==0gen TTnoRR=1 if sampleSD==0 & HIVtreat==1gen attrit=1-update05v2gen RR_TTvneither = .replace RR_TTvneither = 0 if noRRnoTT==1replace RR_TTvneither = 1 if RRandTT==1*for GIRLcollapse sampleSD RR_TTvneither repeat8 secschool training athome attrit evdead05v2 Nobs , by(schoolid girl)xi: reg repeat8 RR_TTvneither  if girl==1foreach var of varlist secschool training athome attrit evdead05v2 {	reg `var'  RR_TTvneither if girl==1 	}*for BOYforeach var of varlist repeat8 secschool training athome attrit evdead05v2 {	reg `var'  RR_TTvneither if girl==0 }*Column 3 - for TT compared to neither TT nor RRuse "/Users/apple/Dropbox/2001/Dupas replication/datasets/SD2005_rev2.dta", cleargen RRWithoutTT=1 if sampleSD==1 & HIVtreat==0gen RRconTT=1 if sampleSD==1 & HIVtreat==1gen RRandTT=1 if sampleSD==1 & HIVtreat==1gen noRRnoTT=1 if sampleSD==0 & HIVtreat==0gen TTnoRR=1 if sampleSD==0 & HIVtreat==1gen attrit=1-update05v2gen TTvneither = .replace TTvneither = 0 if noRRnoTT==1replace TTvneither = 1 if TTnoRR==1*for GIRLcollapse TTvneither sampleSD HIVtreat repeat8 secschool training athome attrit evdead05v2 Nobs , by(schoolid girl)xi: reg repeat8 TTvneither  if girl==1foreach var of varlist secschool training athome attrit evdead05v2 {	reg `var'  TTvneither if girl==1 	}*for BOYforeach var of varlist repeat8 secschool training athome attrit evdead05v2 {	reg `var'  TTvneither if girl==0 }*Column 3 - for effect of RRuse "/Users/apple/Dropbox/2001/Dupas replication/datasets/SD2005_rev2.dta", cleargen RRWithoutTT=1 if sampleSD==1 & HIVtreat==0gen RRconTT=1 if sampleSD==1 & HIVtreat==1gen RRandTT=1 if sampleSD==1 & HIVtreat==1gen noRRnoTT=1 if sampleSD==0 & HIVtreat==0gen TTnoRR=1 if sampleSD==0 & HIVtreat==1gen attrit=1-update05v2gen RRvneither = .replace RRvneither = 0 if noRRnoTT==1replace RRvneither = 1 if RRWithoutTT==1*for GIRLcollapse sampleSD HIVtreat RRvneither repeat8 secschool training athome attrit evdead05v2 Nobs , by(schoolid girl)xi: reg repeat8 RRvneither  if girl==1foreach var of varlist secschool training athome attrit evdead05v2 {	reg `var'  RRvneither if girl==1 & HIVtreat==0	}*for BOYforeach var of varlist repeat8 secschool training athome attrit evdead05v2 {	reg `var'  RRvneither if girl==0 }